#import <Foundation/Foundation.h>
#import "PinNoteManagerDelegate.h"
#import "TouchableWindowDelegate.h"
#import "SFUConstants.h"
#import "GraphicsUtilities.h"
#import "PinNoteViewer.h"

/**
 * A PinNoteManager is an object representing a tool for managing 
 * the interactive placement, editing, and removal of the 
 * user-defined pin notes.
 * 
 * Conforms to the TouchableWindowDelegate protocol.
 *
 * @author      James Lin
 * @version     1.3.7
 * @since       1.0.4
 * @see         TouchableWindowDelegate
 * @see         PinNoteViewerDelegate
 */
@interface PinNoteManager : NSObject <TouchableWindowDelegate, PinNoteViewerDelegate> {
	id<PinNoteManagerDelegate> delegate;              // Delegate handling pin note events
	AddressAnnotation*         currentPinNote;        // Reference to pin note to manage
	BOOL                       isActive;              // Whether the manager has been activated
	BOOL                       placePinModeEnabled;   // Whether it is time to place a pin
	BOOL                       relocationModeEnabled; // Whether it is time to relocate a pin
	CGPoint                    newPinLocation;        // Location of the newly relocated pin
	UIToolbar*                 toolbar;               // Toolbar for the pin note manager
	UIToolbar*                 relocationToolbar;     // Toolbar for relocation of a pin note
	UIBarButtonItem*           addButton;             // The add button on the general toolbar
	NSString*                  pinTitle;              // Cached title of the pin note to manage
	NSString*                  pinDesc;               // Cached notes of the pin note to manage
}

@property (nonatomic, retain) NSString* pinTitle;
@property (nonatomic, retain) NSString* pinDesc;

/**
 * Retrieve the shared instance of the pin note manager.
 *
 * @return  the shared instance of PinNoteManager
 */
+ (PinNoteManager*)sharedPinNoteManager;

/**
 * Activate the map pin note tools.
 *
 * @param theDelegate  the delegate handling pin note events
 */
- (void)activateWithDelegate:(id<PinNoteManagerDelegate>)theDelegate;

/**
 * Display the details of the given pin note.
 *
 * @param pinNote      the pin note of which to display details
 * @param theDelegate  the delegate handling pin note events
 */
- (void)displayPinNote:(AddressAnnotation*)pinNote 
			  delegate:(id<PinNoteManagerDelegate>)theDelegate;

/**
 * Deactive the map pin note tools.
 */
- (void)deactivate;

@end
